import {reqPlayList} from "@/http/api";

export default {
    namespaced: true,//开启命名空间
    state: {
        cat: '全部',
        pageNo: 1,
        pageSize: 35,
        total: 100,
        // 主体中的数据
        playList: [],
        // 弹框中的数据
        catList: [],
        //是否显示弹窗
        isShowList: false,
        catCopy: '全部',
    },
    mutations: {
        GETPLAYLIST(state,data){
            state.playList = data.playlists
        },
        GETCAT(state,data){
            state.total = data.total;
            state.playList = data.playlists;
        },
    },
    actions: {
        async GetPlayList({commit},data) {
            let {
                limit, offset, cat, order
            } = data
            let result = await reqPlayList(limit,offset,cat,order)

            commit('GETCAT',result.data)
        },

    },
    getters: {}
}